<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@taglib uri="http://www.springframework.org/tags" prefix="spring"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>

<%-- <%@taglib uri="spring.tld" prefix="spring"%> --%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
String servletPath = (String)request.getAttribute("javax.servlet.forward.servlet_path");
String[] list = servletPath.split("\\/");
request.setAttribute("role",list[1]);
request.setAttribute("topMenuId",list[2]);
request.setAttribute("leftMenuId",list[3]);
%>

<!DOCTYPE html>
<html>
	<head>
    	<base href="<%=basePath%>">
    
    	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
		<title>试题管理</title>
		<meta name="keywords" content="">
		<link rel="shortcut icon" href="<%=basePath%>resources/images/favicon.ico" />
		<link href="resources/bootstrap/css/bootstrap-huan.css" rel="stylesheet">
		<link href="resources/font-awesome/css/font-awesome.min.css" rel="stylesheet">
		<link href="resources/css/style.css" rel="stylesheet">
		
		<link href="resources/css/exam.css" rel="stylesheet">
		<link href="resources/chart/morris.css" rel="stylesheet">
		<style>
			.examing-point{
				display:block;
				font-size:10px;
				margin-top:5px;
			}
/* 			input[disabled]{
			  outline:1px solid red; 
			}
*/		
 		</style>
	</head>
	<body>
		<span style="display:none;" id="rule-role-val"><%=list[1]%></span>
		<!-- Navigation bar starts -->

		

		<!-- Navigation bar ends -->

		<!-- Slider starts -->

		<div>
			<!-- Slider (Flex Slider) -->

			<div class="container" style="min-height:430px;width:1024px;">

				<div class="row">
					
					<div class="col-xs-12">
						
						<div>

							<div id="question-filter">
								<input type="hidden" id="examPaperId" value="${examPaperId}">
								<dl id="question-filter-field" style="display: none">
                                    <dt>
                                        专业题库：
                                    </dt>
                                    <dd>
                                        <c:choose>
                                            <c:when test="${questionFilter.fieldId == 0 }">
                                                <span data-id="0" class="label label-info">全部</span>
                                            </c:when>
                                            <c:otherwise>
                                                <span data-id="0">全部</span>
                                            </c:otherwise>
                                        </c:choose>

                                        <c:forEach items="${fieldList}" var="field">
                                            <c:choose>
                                                <c:when test="${questionFilter.fieldId == field.fieldId }">
                                                    <span class="label label-info" data-id="${field.fieldId}">${field.fieldName}</span>
                                                </c:when>
                                                <c:otherwise>
                                                    <span data-id="${field.fieldId}">${field.fieldName}</span>
                                                </c:otherwise>
                                            </c:choose>
                                        </c:forEach>
                                    </dd>
								</dl>
								<dl id="question-filter-knowledge">
									<dt>
										知识分类：
									</dt>
									<dd>
										<c:choose>
											<c:when test="${questionFilter.knowledge == 0 }">
												<span data-id="0" class="label label-info">全部</span>
											</c:when>
											<c:otherwise>
												<span data-id="0">全部</span>
											</c:otherwise>
										</c:choose>
										<c:forEach items="${knowledgeList}" var="knowledge">
											<c:choose>
												<c:when test="${questionFilter.knowledge == knowledge.pointId }">
													<span data-id="${knowledge.pointId}" class="label label-info">${knowledge.pointName}</span>
												</c:when>
												<c:otherwise>
													<span data-id="${knowledge.pointId}">${knowledge.pointName}</span>
												</c:otherwise>
											</c:choose>
										</c:forEach>
									</dd>
								</dl>

								<dl id="question-filter-qt">
									<dt>
										试题类型：
									</dt>
									<dd>
										<c:choose>
											<c:when test="${questionFilter.questionType == 0 }">
												<span data-id="0" class="label label-info">全部</span>
											</c:when>
											<c:otherwise>
												<span data-id="0">全部</span>
											</c:otherwise>
										</c:choose>
										<c:forEach items="${questionTypeList}" var="questionType">
											<c:choose>
												<c:when test="${questionFilter.questionType == questionType.id }">
													<span data-id="${questionType.id}" class="label label-info">${questionType.name}</span>
												</c:when>
												<c:otherwise>
													<span data-id="${questionType.id}">${questionType.name}</span>
												</c:otherwise>
											</c:choose>
										</c:forEach>

									</dd>
								</dl>
							</div>
							<div id="question-list">
								<input id="field-id-hidden" value="${fieldId }" type="hidden">
								<input id="knowledge-hidden" value="${knowledge }" type="hidden">
								<input id="question-type-hidden" value="${questionType }" type="hidden">
								<input id="search-param-hidden" value="${searchParam }" type="hidden">
								<table class="table-striped table">
									<thead>
										<tr>
											<td>选择</td><td>ID</td><td>试题名称</td><td style="width: 90px;">试题类型</td><td>专业题库</td>
											<td>知识分类</td><td>难度</td><td>试题状态</td><td>开放状态</td><td>创建人</td>
										</tr>
									</thead>
									<tbody>
										
										<c:forEach items="${questionList }" var="items">
											<tr>
												<td>
													<c:if test="${items.status =='5'}">
														<input type="checkbox" value="${items.id }">
													</c:if>
													<c:if test="${items.status !='5'}">
														<input type="checkbox" value="${items.id }" style="display: none;">
													</c:if>
												</td>
												<td class="question-id">${items.id }</td>
												<td>
													<a href="<%=list[1]%>/question/question-preview/${items.id }" target="_blank" title="预览">${items.name }</a>
												</td>
												
												<td>${items.questionTypeName }</td>
												<td>${items.fieldName }</td>
												<td>${items.pointName }</td>
												<td>
													<c:choose>
														<c:when test="${items.difficulty =='1'}">一星</c:when>
														<c:when test="${items.difficulty =='2'}">二星</c:when>
														<c:when test="${items.difficulty =='3'}">三星</c:when>
														<c:when test="${items.difficulty =='4'}">四星</c:when>
														<c:when test="${items.difficulty =='5'}">五星</c:when>
													</c:choose>
												</td>
												<td>
													<c:choose>
														<c:when test="${items.status =='1'}">草稿</c:when>
														<c:when test="${items.status =='2'}">审核中</c:when>
														<c:when test="${items.status =='3'}">已审核</c:when>
														<c:when test="${items.status =='4'}">申请发布</c:when>
														<c:when test="${items.status =='5'}">已发布</c:when>
														<c:when test="${items.status =='6'}">申请作废</c:when>
														<c:when test="${items.status =='7'}">已作废</c:when>
													</c:choose>
												</td>
												<td>
													<c:choose>
														<c:when test="${items.is_visible==true}">
															已开放
														</c:when>
														<c:otherwise>
															未开放
														</c:otherwise>
													</c:choose>
												</td>
												<td>${items.creator }</td>
											</tr>
										</c:forEach>
										

									</tbody><tfoot></tfoot>
								</table>
							</div>
							<div class="page-link-content">
								<ul class="pagination pagination-sm">${pageStr}</ul>
							</div>

						</div>
					</div>
				</div>
			</div>
		</div>

		

		<!-- Slider Ends -->

		<!-- Javascript files -->
		<!-- jQuery -->
		<script type="text/javascript" src="resources/js/jquery/jquery-1.9.0.min.js"></script>
		<!-- Bootstrap JS -->
		<script type="text/javascript" src="resources/bootstrap/js/bootstrap.min.js"></script>
		<script type="text/javascript" src="resources/js/all.js"></script>
		<script type="text/javascript" src="resources/js/question-list4dialog.js?v=1"></script>
	</body>
</html>
